package com.project_doctor.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
 - 消息队列的配置类
 */
@Slf4j
@Configuration
public class RabbitConfig {

    @Bean
    public Queue smsQueue() {
        return new Queue("sms.queue");
    }
    /**
     * 消息序列化成JSON字符串
     */
    @Bean
    public MessageConverter messageConverter() {
        return new Jackson2JsonMessageConverter();
    }
}